/************************************
*************************************
       自选行情显示页面
*************************************
*************************************/
#ifndef MARKETSELFWIDGET_H
#define MARKETSELFWIDGET_H

#include <QWidget>
#include <string.h>
#include <qgridlayout.h>
#include "tableview.h"

class MarketSelfWidget : public QWidget
{
    Q_OBJECT
public:
    explicit MarketSelfWidget(QWidget *parent = 0);

signals:
    void UpdateRow(int iIndex,QStringList row_list);
    void SigControlWgtInfo(double buy1,double buy1cnt,double sell1, double sell1cnt);

public slots:
    void SelectSelfContract(const QModelIndex &index);

public:
    void setupModel();
    void setupViews();
    void ShowDepthMarketData(const char* msg);

	double GetBuy1Price(QString code);
	double GetSell1Price(QString code);
    double GetLastPrice(QString code);

public:
    TableView*  m_tableView;
    QItemDelegate* m_MarketselfDelegate;

private:
    QString m_strCurrContract;

    QItemSelectionModel *selectionModel;
    QGridLayout *MainLayout;

    QMap<QString,double> m_MapLastPrice;
	QMap<QString,double> m_MapBuy1Price;
	QMap<QString,double> m_MapSell1Price;
};

#endif // MARKETSELFWIDGET_H
